#pragma once

#include <robot_chassis/CTurnOnRobot.hpp>
#include <geometry_msgs/msg/twist.hpp>
#include <rclcpp/rclcpp.hpp>

/**
 * @brief 速度控制节点，负责接收速度指令并发送给STM32
 * 
 * 订阅标准的 /chassis/cmd_vel 话题，将速度指令发送给下位机
 */
class CRobotControl : public rclcpp::Node
{
  public:
    CRobotControl(const std::string& nodeName);
    ~CRobotControl();

  private:
    void startReceive();
    void callback(const geometry_msgs::msg::Twist::SharedPtr msg);

    rclcpp::Subscription<geometry_msgs::msg::Twist>::SharedPtr sub_;
    CTurnOnRobot&                                              turnonRobot_;
    SVelocityData                                              setRobotVel_;
};
